<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            background-color: #f00;
            position: absolute;
            left: 0;
        }
    </style>
</head>

<body>

    <div></div>


    <script src="../js/move.js"></script>
    <script>


        var oDiv = document.querySelector('div');
        // move(oDiv, 10, 1200, 'left', function () {
        //     move(oDiv, 10, 0, 'left')
        // })



        f()
        function f() {
            move(oDiv, 10, 1200, 'left', function () {
                move(oDiv, 10, 0, 'left', function () {
                    f()
                })
            })
        }


    </script>

</body>

</html>